package Client;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.text.BadLocationException;
import javax.swing.text.StyleConstants;

public class SFBIC extends Client_Gui{
	private JPanel panel;
	
	public JPanel addComponents(JPanel panelClient){
		panel = panelClient;
		JButton bold = new JButton("B");
		bold.setBounds(15, 343, 45, 20);
		panel.add(bold);
		
		JButton italic = new JButton("I");
		italic.setBounds(65, 343, 45, 20);
		panel.add(italic);
		
		JButton under = new JButton("U");
		under.setBounds(115, 343, 45, 20);
		panel.add(under);
		
		JLabel labelSize = new JLabel("Size:");
		labelSize.setBounds(165, 343, 55, 20);
		panel.add(labelSize);
		
		String size[] = {"12","14", "16", "18","20"};
		final JComboBox comboSize = new JComboBox(size);
		comboSize.addItemListener(new ItemListener() {
			
			@Override
			public void itemStateChanged(ItemEvent ie) {
				int dim = Integer.parseInt((String) comboSize.getSelectedItem());
				StyleConstants.setFontSize(style, dim);
				try{
					document.insertString(document.getLength(), " ", style);
				}catch(BadLocationException e){
					System.out.println(e);
					e.printStackTrace();
				}
				inputTextArea.requestFocusInWindow();
				
			}
		});
		comboSize.setBounds(195, 343, 55, 20);
		panel.add(comboSize);
		
		
	
		
		return panel;
		
	}

}
